package com.atguigu.gulimall.search.thread;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 测试多线程
 * @author 孤风雪影
 * @date 2021/1/12
 */
public class ThreadTest {
    public static ExecutorService executorService = Executors.newFixedThreadPool(10);

    public static void main(String[] args) {
        System.out.println("main......start......");
        CompletableFuture.runAsync(()->{
            System.out.println("当前线程: " + Thread.currentThread().getId());
            int i = 10 /2;
            System.out.println("运行结果：" + i);
        },executorService);
        System.out.println("main......end......");
    }

}